package com.kqb.autoconfigure;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author 杉果树皮
 * @date 2025/2/12 19:47
 * @description:
 */
@ConfigurationProperties(prefix = "token.interceptor")
public class TokenInterceptorProperties {

    private static final String[] DEFAULT_PATH_PATTERNS = {"/**"};
    private static final String[] DEFAULT_EXCLUDE_PATH_PATTERNS = {"/login", "/register"};

    private String[] pathPatterns; //拦截的路径
    private String[] excludePathPatterns; //不拦截的路径


    public String[] getPathPatterns() {
        if (pathPatterns == null) {
            return DEFAULT_PATH_PATTERNS;
        }
        return pathPatterns;
    }

    public void setPathPatterns(String[] pathPatterns) {
        this.pathPatterns = pathPatterns;
    }

    public String[] getExcludePathPatterns() {
        if (excludePathPatterns == null) {
            return DEFAULT_EXCLUDE_PATH_PATTERNS;
        }
        return excludePathPatterns;
    }

    public void setExcludePathPatterns(String[] excludePathPatterns) {
        this.excludePathPatterns = excludePathPatterns;
    }
}
